package com.doit.day01

object _04_类型转换 {
  def main(args: Array[String]): Unit = {

    val num = "20"

    val int: Int = num.toInt

    val double: Double = num.toDouble

    val long: Long = num.toLong


    //int  double  long ==> 进行计算
    //自动类型提升  ==> 提升到参与运算的所有类型中，最大精度的类型
    val d: Double = int + double + long

    //byte  short char
    val a:Char = 'a'
    val b:Short = 1
    val c:Byte = 2

    val res: Int = a+b+c
    println(res)

  }

}
